package com.example.manager.service.impl;

import com.example.manager.mapper.OrderMapper;
import com.example.manager.service.OrderService;
import com.example.manager.domain.Order;
import com.example.manager.pojo.Code;
import com.example.manager.pojo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    public Result<List<Order>> selectOrders() {
        List<Order> orders = orderMapper.selectOrders();
        int i;
        return new Result<List<Order>>(orders, Code.RESPONSE_CODE_SUCCESS, "查询成功");
    }

    @Override
    public Result deleteOrder(Integer orderId) {
        orderMapper.deleteOrderByOrder_Id(orderId);
        return new Result (Code.RESPONSE_CODE_SUCCESS, "删除成功");
    }
}
